<!DOCTYPE html>
<html>
<head>
	<title>登录</title>
	<link rel="stylesheet" href="{{url_for('static',filename='amis/sdk.css')}}" />
	<script src="{{url_for('static',filename='amis/sdk.js')}}"></script>
	<style type="text/css">
		.login-div .a-Grid-col--lg2 {
		    display: block;
		    margin: 0 auto;
		    width: 500px<br> ；;
		}
	</style>
</head>
<body>
	<div id="root"></div>
</body>
<script type="text/javascript">
	(function () {
        let amis = amisRequire('amis/embed');
        // 通过替换下面这个配置来生成不同页面
        let amisScoped = amis.embed('#root', 
        {
          type: 'page',
          title: '',
          body: [
          	{//登录页面 start
          		type:'container',
          		name:'page-login',
        		className: "login-div",
          		body:[

		          	{
		                "type": "hbox",
		                "className": "m-t-xxl text-center",
		                "columns": [
		                  {
		                   	"type": "icon",
		            		"className": "text-4x m-b-xxl m-t-xxl",
		                  	"icon": "users"
		                  },
		                ]
		          	},
		          	{
                        "type": "html",
                        "html":"<h1><center>管理系统${is_login}</center></h1>"
                  	},
		          	{
		          	type:'grid',
		          	columns:[
			          {
			            type: 'form',
			          	title: '',
			            mode: 'horizontal',
			            redirect:'index',
			            lg:2,
			            lgOffset:5,
			            className:'',
			            api:{
			                 "method": "post",
			                 "url": "/login",
			                 // "dataType": "form"
			            },
			            submitText:'登录',
			            horizontal: {//设置位置
					      "left": 4,
					    },
					    resetAfterSubmit:true,
			            controls: [
			              {
			            	size:'xs',
			            	required:1,
			                label: '账号',
			                type: 'text',
			                validations:{
			                	isAlphanumeric:1,
			                	minLength:5,
			                	maxLength:20,
			                },
			                name: 'admin'
			              },
			              {
			            	size:'xs',
			            	required:1,
			                label: '密码',
			                validations:{
			                	minLength:5,
			                },
			                type: 'password',
			                name: 'pwd'
			              }
			            ]
			          }

		          	],
		          },
          		]
          	}//登录页面 end
          ]
        }

        );
      })();
	
</script>
</html>